unit uCommandline;
(*

  Command line interface for eConsole

*)
interface
Uses SysUtils;

Function ProcessCommandline( var rTrace : Boolean; var rINIFilename : String; var rCommandLine : String;
                             var rForceWin9x : Boolean ) : Boolean;
(*
  Processes the command line for eConsole, returns false if an error occurred in the command line
*)

implementation

Function ProcessCommandline;
Var I : Integer;
    S : String;
Begin
  I := 1;
  While I <= ParamCount do
    Begin
      S := UpperCase( ParamStr( I ));
      If S = '-D'
        then
          Begin
            Inc( I );
            rTrace := True;
          End
        else
      If S = '-C'
        then
          Begin
            Inc( I );
            rCommandLine := '';
            While I <= ParamCount do
              Begin
                If rCommandLine = ''
                  then rCommandLine := rCommandLine + ParamStr( I )
                  else rCommandLine := rCommandLine + ' ' + ParamStr( I );
                Inc( I );
              End;
          End
        else
      If S = '-T'
        then
          Begin
            Inc( I );
            If I <= ParamCount
              then rINIFilename := ParamStr( I );
          End
        else
      If S = '-W'
        then
          Begin
            Inc( I );
            rForceWin9x := True;
          End
        else ;
      Inc( I );
    End;
  Result := True;
End;

end.
